package com.zx.fm.service.impl;

import com.zx.fm.domain.ReimbursementApplication;
import com.zx.fm.domain.ReimbursementApplicationVO;
import com.zx.fm.mapper.ReimbursementApplicationMapper;
import com.zx.fm.service.IReimbursementApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * -- 高贵的马儿驱逐体内的一切外力 --
 *
 * @author kaajee
 * @date 2025/9/1
 * @desc
 */
@Service
public class ReimbursementApplicationServiceImpl implements IReimbursementApplicationService {
    @Autowired
    private ReimbursementApplicationMapper reimbursementApplicationMapper;
    @Override
    public List<ReimbursementApplicationVO> RAlist(ReimbursementApplicationVO raVO) {
        return reimbursementApplicationMapper.selectAll(raVO);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertRA(ReimbursementApplication reimbursementApplication) {
        return reimbursementApplicationMapper.insert(reimbursementApplication);
    }

    @Override
    public int updateRA(ReimbursementApplication reimbursementApplication) {
        return reimbursementApplicationMapper.updateByPrimaryKeySelective(reimbursementApplication);
    }

    @Override
    public ReimbursementApplicationVO selectRAById(Long id) {
        return reimbursementApplicationMapper.selectById(id);
    }

    @Override
    public int deleteRAById(Long id) {
        return reimbursementApplicationMapper.deleteById(id);
    }
}
